<template>
  <div>
    <base-info-m-g v-if="projectClass == '62' && projectType == 'MG' " ref="baseInfoMg" :project-build-id="projectBuildId" 
          :sel-project-type="projectType" :change-id="changeId"></base-info-m-g>
  </div>
</template>
<script>
import { strNotNull } from '@/utils/common.js'
import { getAction } from '../../api/manage'
export default {
  components: {
    BaseInfoMG: () => import('@/components/tools/hatchProjectBuildStep/baseInfo/BaseInfoMG')
  },
  data() {
    return {
      projectBuildId: '',
      projectClass: '',
      projectType: '',
      changeId: '',
      currentAudit: false,
      url:{
        getProjectBuild:'/hatchProjectBuild/queryById',
      },
    }
  },
  methods: {
    getProjectBuild() {
      if (this.projectBuildId == null || this.projectBuildId == '') {
        return;
      }
      getAction(this.url.getProjectBuild, { id: this.projectBuildId })
        .then((res) => {
          if (res.code == 200) {
            this.projectClass = res.result.projectClass
            this.projectType = res.result.hatchProjectType
          } else {
            this.$message.warning('查询孵化立项信息失败:' + res.message)
          }
        })
        .catch((res) => {
          this.$message.warning('查询孵化立项信息失败:' + res.message)
        })
    },
  },
  mounted() {
    this.projectBuildId = this.$route.query.hatchProjectBuildId
    this.projectClass = this.$route.query.projectClass
    this.projectType = this.$route.query.projectType
    this.changeId = this.$route.query.changeId 
    this.currentAudit = this.$route.query.currentAudit 
    if (!strNotNull(this.projectClass) || !strNotNull(this.projectType)) {
      this.getProjectBuild()
    }
  },
}
</script>
<style lang="less" scoped>
  @import '~@assets/less/hte-main.less';
</style>